/*
 * calledByExecTest.c
 *
 *  Created on: Jun 18, 2011
 *      Author: peckb1
 */

#include "syscall.h"
#include "usercommon.h"

int locks[10];
int i;

int
main() {
	printLock = CreateLock("Printing Lock");
    printf("[CHILD PROCESS 1] I'm the program that was called by Exec.\n");
    printf("[CHILD PROCESS 1] Lets create some locks\n");
    for(i = 0; i < 10; i++) {
        locks[i] = CreateLock("Lock name here");
    }
    printf("[CHILD PROCESS 1] Lets Yield\n");
    for(i = 0; i < 10; i++) {
        Yield();
    }
    printf("[CHILD PROCESS 1] Lets create destroy the locks\n");
    for(i = 0; i < 10; i++) {
        DestroyLock(locks[i]);
    }
    printf("[CHILD PROCESS 1] Lets exit\n");
    Exit(0);
}
